const getOpenId = require('./getOpenId/index');
const getMiniProgramCode = require('./getMiniProgramCode/index');
const createCollection = require('./createCollection/index');
const selectRecord = require('./selectRecord/index');
const updateRecord = require('./updateRecord/index');
const sumRecord = require('./sumRecord/index');
const youSelectRecord = require('./youSelectRecord/index');
const tangSelectRecord = require('./tangSelectRecord/index');
const douSelectRecord = require('./douSelectRecord/index');


// 云函数入口函数
exports.main = async (event, context) => {
  console.log("111", event, context);
  switch (event.type) {
    case 'getOpenId':
      return await getOpenId.main(event, context);
    case 'getMiniProgramCode':
      return await getMiniProgramCode.main(event, context);
    case 'createCollection':
      return await createCollection.main(event, context);
    case 'selectRecord':
      return await selectRecord.main(event, context);
    case 'updateRecord':
      return await updateRecord.main(event, context);
    case 'sumRecord':
      return await sumRecord.main(event, context);
    case 'youSelectRecord':
      return await youSelectRecord.main(event, context);
    case 'tangSelectRecord':
      return await tangSelectRecord.main(event, context);
      case 'douSelectRecord':
        return await douSelectRecord.main(event, context);
  }
};